import { http } from "@/utils/http";
export function getGoodsPageList(data: Partial<ShopGoodsPageRequest & PageRequest>) {
  return http.post<MResponse<PageVo<Array<ShopGoodsVo>>>>("/product/goods/getGoodsPageList", { data });
}

export function addGoods(data: ShopGoodsAddRequest) {
  return http.postJson<MResponse>("/product/goods/addGoods", { data });
}

export function updateGoods(data: ShopGoodsUpdateRequest) {
  return http.postJson<MResponse>("/product/goods/updateGoods", { data });
}

export function delGoods(data: ShopGoodsDelRequest) {
  return http.post<MResponse>("/product/goods/delGoods", { data });
}

export function getGoodsDetail(productId: number) {
  return http.post<MResponse<ShopGoodsDetailVo>>("/product/goods/getGoodsDetail", { data: { productId } });
}
